Shortcut Fusion of Monadic Programs

نویسندگان

  • Cecilia Manzino
  • Alberto Pardo
چکیده

Functional programs often combine separate parts of the program using intermediate data structures for communicating results. Programs so defined are easier to understand and maintain, but suffer from inefficiency problems due to the generation of those data structures. In response to this problematic, some program transformation techniques have been studied with the aim to eliminate the intermediate data structures that arise in function compositions. One of these techniques is known as shortcut fusion. This technique has usually been studied in the context of purely functional programs. In this work we propose an extension of shortcut fusion that is able to eliminate intermediate data structures generated in the presence of monadic effects. The extension to be presented can be uniformly defined for a wide class of data types and monads.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Multiple Intermediate Structure Deforestation by Shortcut Fusion

Shortcut fusion is a well-known optimization technique for functional programs. Its aim is to transform multi-pass algorithms into single pass ones, achieving deforestation of the intermediate structures that multi-pass algorithms need to construct. Shortcut fusion has already been extended in several ways. It can be applied to monadic programs, maintaining the global effects, and also to obtai...

متن کامل

Applicative Shortcut Fusion

In functional programming one usually writes programs as the composition of simpler functions. Consequently, the result of a function might be generated only to be consumed immediately by another function. This potential source of inefficiency can often be eliminated using a technique called shortcut fusion, which fuses both functions involved in a composition to yield a monolithic one. In this...

متن کامل

A shortcut fusion approach to accumulations

In functional programming it is common to write programs as composition of other simpler functions. This makes it possible to take advantage of the well-known benefits of modular programming. However, in many cases, the resulting programs have efficiency problems caused by the generation of data structures that are solely used for communication between the intervening functions in the compositi...

متن کامل

Monadic Fold, Monadic Build, Monadic Short Cut Fusion

Short cut fusion improves the efficiency of modularly constructed programs by eliminating intermediate data structures produced by one program component and immediately consumed by another. We define a combinator which expresses uniform production of data structures in monadic contexts, and is the natural counterpart to the well-known monadic fold which consumes them. Like the monadic fold, our...

متن کامل

MATHEMATICAL ENGINEERING TECHNICAL REPORTS Solving Maximum Weighted-sum Problems for Free

Efficient algorithms are necessary for solving problems effectively. However, efficient algorithms are hard to develop, implement, and maintain. Therefore, it has been very difficult for those with little algorithmic knowledge to solve their problems based on efficient algorithms. In this paper, we introduce a way to develop efficient algorithms for finding optimal sequences, especially sequenc...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. UCS

دوره 14  شماره 

صفحات  -

تاریخ انتشار 2008